<template>
  <el-dialog width="30%" title="修改容器状态" :visible.sync="dialogVisible" :before-close="close">
    <el-form ref="form" size=mini :model="form" label-width="120px">
      <el-row>
        <el-col :span="20">
          <el-form-item label="变更状态：">
            <el-select v-model="form.state" :placeholder="$t('m.choose')+'变更状态'">
              <el-option
                v-for="(item,index) in options"
                :key="index"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row>
      <el-button size=mini @click="close">{{$t('m.cancel')}}</el-button>
      <el-button size=mini type="primary" @click="save(form.state)">{{$t('m.save')}}</el-button>
    </el-row>
  </el-dialog>
</template>
<script>
export default {
  name:'type-setting',
  props:['dialogVisible','options'],
  data(){
    return {
      form:{
        state:''
      }
    }
  },
  methods:{
    close(){
      this.form.state = ''
      this.$emit('close')
    },
    save(state){
      if(state==='') return this.callbackMessage('请选择容器状态')
      this.$emit('save',state)
    }
  }
}
</script>